{% extends "base.html" %}

{% block title %}
首页
{% endblock %}

{% block content %}

{% for item in page.records %}
<div id="topic{{item.id|uw}}" class="post_list">
  <h2><a href="/topic/get?id={{item.id|uw}}">{{item.title|uw}}</a></h2>
  <div class="excerpt">
    {%if item.pic|not_null%}
    <div class="thumbnail"><a href="/topic/get?id={{item.id|uw}}"><img src="{{item.pic|uw}}"></a></div>
    {%endif%}
    <div class="textPost" data-url="/topic/get?id={{item.id|uw}}">{{item.sum|uw}}</div>
  </div>
  <div class="meta">
    <p class="time">{{item.atime|uw|dt}}
      {%if item.ist|uw == 1 %}<span class="ico">顶</span>{%endif%}
    </p>
    <p class="navPost">
      <a href="/topic/get?id={{item.id|uw}}"><i class="iconfont">&#xe61e;</i> 评论({{item.num|uw}})</a>
      {% if base.login%}
      <a id="zd-{{item.id|uw}}" href="javascript:void(0)" ist="{{item.ist|uw}}" onclick="zdlog('{{item.id|uw}}',0)">{%if
        item.ist|uw == 0 %}置顶{%else%}取消{%endif%}</a>&nbsp;
      <a href="/post?id={{item.id|uw}}" title="编辑博客">编辑</a>&nbsp;
      <a href="javascript:void(0)" onclick="dellog('{{item.id|uw}}','1')">删除</a>
      {%endif%}
    </p>
  </div>
</div>
{% endfor %}
<div class="pagination">
  <span class="info"> 共计：{{page.total}} 条记录 每页:{{page.page_size}}条</span>
  {% if page.total_page > 1 %}
  {% let ps="{}{}{}"|format(base.kw|add("&kw="),base.t|add("&t="),base.c|add("&c=")) %}
  <a href='/index?{{ps}}'>首页</a>
  <a href='/index?page_no={{page.pre_page}}{{ps}}'>&lt;</a>
  {% for p in page.pages %}
  {% if p.eq(page.cur_page) %}
  <span class="current">{{p}}</span>
  {% else %}
  <a href='/index?page_no={{p}}{{ps}}'>{{p}}</a>
  {% endif %}
  {% endfor %}
  <a href='/index?page_no={{page.next_page}}{{ps}}'>&gt;</a>
  <a href='/index?page_no={{page.total_page}}{{ps}}'>尾页</a>
  {% endif %}
</div>
{% endblock %}

{% block script %}
<script type="text/javascript">
  var ma = $("#menu-{{base.c|uw}}");
  if(ma && ma.length>0){
    ma.addClass("on");
  }
</script>
{% endblock %}